CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8
  1. #1
    Join Date
    Aug 2018
    Posts
    4

    Cannot run C++ console application on Azure

    I have a console application written with Visual C++, which is created image metal file and bmp file. It works perfectly on Window system, but on Azure, nothing happened, not creating any image files.
    Any suggestions and help will be appreciated!


    Wei

  2. #2
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,635

    Re: Cannot run C++ console application on Azure

    I've never used Azure so I'm not sure what debugging tools are available, but you may want to write to a log file at various points in your program to see how far it gets.

  3. #3
    Join Date
    Aug 2018
    Posts
    4

    Re: Cannot run C++ console application on Azure

    Quote Originally Posted by GCDEF View Post
    I've never used Azure so I'm not sure what debugging tools are available, but you may want to write to a log file at various points in your program to see how far it gets.
    I cannot write debugging files on Azure either. Be more specific, it is on Azure App Services.

    Thanks,

    Wei

  4. #4
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: Cannot run C++ console application on Azure

    Quote Originally Posted by geomark View Post
    I cannot write debugging files on Azure either. Be more specific, it is on Azure App Services.

    Thanks,

    Wei
    Why would you expect to be able to run a native Windows console application as an Azure app service?

  5. #5
    Join Date
    Aug 2018
    Posts
    4

    Re: Cannot run C++ console application on Azure

    Quote Originally Posted by Arjay View Post
    Why would you expect to be able to run a native Windows console application as an Azure app service?
    The website is hosted on an Azure app service. In the web application it needs to run a console application to create image files. Does anybody know how to create image files (.gif, .bmp or .emf) on Azure app service?


    Thanks,

    Wei

  6. #6
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: Cannot run C++ console application on Azure

    Not sure why you needed a console app in the pre-Azure website to save the files.

    In pre-Azure (.net core shown below), if the file was uploaded by a user, you could save it with (filePath is the destination path and IFormFile is the uploaded file):
    Code:
    public async Task UploadSupportingDocumentAsync(string filePath, IFormFile formFile)
    {
      using (var stream = new FileStream(filePath, FileMode.Create))
      {
        await formFile.CopyToAsync(stream);
      }
    }
    If the files weren't uploaded, did the console app generate the file images? If so, convert the console app to a Azure service and do the same in C#.

    Lastly, there are all sorts of file storage options in Azure. Google for the various options.
    Last edited by Arjay; August 29th, 2018 at 11:51 PM.

  7. #7
    Join Date
    Aug 2018
    Posts
    4

    Re: Cannot run C++ console application on Azure

    Quote Originally Posted by Arjay View Post
    Not sure why you needed a console app in the pre-Azure website to save the files.

    In pre-Azure (.net core shown below), if the file was uploaded by a user, you could save it with (filePath is the destination path and IFormFile is the uploaded file):
    Code:
    public async Task UploadSupportingDocumentAsync(string filePath, IFormFile formFile)
    {
      using (var stream = new FileStream(filePath, FileMode.Create))
      {
        await formFile.CopyToAsync(stream);
      }
    }
    If the files weren't uploaded, did the console app generate the file images? If so, convert the console app to a Azure service and do the same in C#.

    Lastly, there are all sorts of file storage options in Azure. Google for the various options.

    Thank you for your response.
    The image files are not created on Azure service using my console application written by visual c++

    Regards,

    Wei

  8. #8
    Join Date
    Mar 2024
    Location
    united states
    Posts
    1

    Re: Cannot run C++ console application on Azure

    Migrating and Running C++ Console Applications on Azure: Challenges and Solutions

    Migrating C++ console applications to Azure and successfully running them can present unique challenges due to differences in environment configurations, dependencies, and deployment processes. However, with careful planning and utilization of Azure services, these challenges can be overcome effectively.

    Challenges in Migrating C++ Console Applications to Azure:

    Environment Configuration: Azure infrastructure differs from traditional on-premises environments, requiring adjustments to configurations related to operating systems, libraries, and runtime environments.

    Dependencies Management: C++ applications often rely on external dependencies and libraries, which need to be managed and integrated into the Azure environment. Ensuring compatibility and availability of these dependencies can be challenging during migration.

    Deployment Process: Transitioning from on-premises deployment models to Azure requires understanding Azure's deployment mechanisms, such as Azure App Service, Azure Virtual Machines, or Azure Container Instances, and adapting the application deployment accordingly.

    Networking and Security: Addressing networking considerations, such as network security groups, virtual networks, and access controls, is essential to ensure secure communication between the C++ application and other Azure services.

    Solutions for Migrating and Running C++ Console Applications on Azure:

    Containerization with Azure Container Instances (ACI): Containerizing the C++ application using Docker and deploying it to Azure Container Instances simplifies deployment and provides flexibility in managing dependencies and runtime environments.


    Azure Virtual Machines (VMs):
    Provisioning Azure VMs with the appropriate configurations allows running C++ applications in an environment similar to on-premises setups. VM extensions and custom images can streamline environment setup and management.


    Azure App Service:
    Leveraging Azure App Service, particularly the Windows App Service for C++, enables deploying and running C++ console applications with minimal configuration overhead. App Service offers scalability, automatic OS updates, and integration with Azure DevOps for continuous deployment.

    Azure Functions: Refactoring parts of the C++ application into Azure Functions allows leveraging serverless computing for specific tasks or functionalities. Azure Functions support various programming languages, including C++ via custom handlers.

    Integration with Azure DevOps: Utilize Azure DevOps pipelines for automated builds, testing, and deployment of the C++ . Azure DevOps provides robust CI/CD capabilities and integrates seamlessly with Azure services.

    Networking and Security Considerations: Configure Azure networking components, such as virtual networks, subnets, and network security groups, to facilitate secure communication between the C++ application and other Azure resources. Utilize Azure Key Vault for managing sensitive data and credentials securely.
    Last edited by 2kaud; March 27th, 2024 at 07:06 AM. Reason: Web link removed

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured