Ich möchte ein zip-File in meiner Sandbox hochladen und diese mit streamlit starten. Was muss ich tun?

Christ, Michael 0 Zuverlässigkeitspunkte
2025-10-14T15:33:41.33+00:00

Ich möchte ein zip-File in meiner Sandbox hochladen und diese mit streamlit starten. Was muss ich tun?

Foundry Tools
Foundry Tools

Früher bekannt als Azure-KI-Dienste oder Azure Cognitive Services; eine einheitliche Sammlung vordefinierter KI-Funktionen innerhalb der Microsoft Foundry-Plattform


1 Antwort

Sortieren nach: Am hilfreichsten
  1. Anshika Varshney 15,640 Zuverlässigkeitspunkte Externe Microsoft-Mitarbeiter Moderator
    2025-10-14T19:28:21.0033333+00:00

    Hello Christ, Michael,

    Thank you for reaching out on the Microsoft Q&A.

    It sounds like you want to upload a ZIP file to your Azure Sandbox and run a Streamlit app. Here is how you can do it:

    1. Prepare Your ZIP File

    • Make sure the ZIP file only contains the necessary components of your Streamlit app (e.g., app.py, requirements.txt) and does not include hidden files or directories like .venv or .git.
    • On Windows, you can use 7-Zip, and on macOS/Linux, use the terminal:
        
        zip -r myapp.zip . -x '.??*'
        
      

    2. Upload the ZIP File

    • Using Azure CLI:
        
        resourceGroupName='yourResourceGroup'
        appServiceName='yourAppServiceName'
        
        az webapp deploy --name $appServiceName --resource-group $resourceGroupName --src-path <path-to-your-zip-file>
        
      
    • Alternatively, using cURL:
        
        curl -X POST -H 'Content-Type: application/zip' -u '<deployment-user>' -T <zip-file-name> <your-deployment-url>
        
      
      To get the deployment URL:
      • Go to your app in the Azure portal.
      • Navigate to Development Tools → Advanced Tools → Go.
      • Use the URL in the address bar and append /api/zipdeploy.

    3. Run Your Streamlit App

    • Set the app to run from the ZIP package:
        
        az webapp config appsettings set --resource-group $resourceGroupName --name $appServiceName --settings WEBSITE_RUN_FROM_PACKAGE="1"
        
      
    • After deployment, access your Streamlit app via the Azure Web App URL. References:

    Quickstart: Deploy a Python (Django, Flask, or FastAPI) web app to Azure App Service

    Run your app in Azure App Service directly from a ZIP package

    If you feel that your quires have been resolved, please accept the answer by clicking the "Upvote" and "Accept Answer" on the post. Otherwise, will respond with more details like ( Do you have Azure CLI installed and configured?, Which Streamlit version are you using?, Have you already set up your Azure App Service, or do you need help with that? )and we will try to help.

    Thankyou!

    War diese Antwort hilfreich?


Ihre Antwort

Antworten können von Fragestellenden als „Angenommen“ und von Moderierenden als „Empfohlen“ gekennzeichnet werden, wodurch Benutzende wissen, dass diese Antwort das Problem des Fragestellenden gelöst hat.