咨询:Azure中storage_account_name等存储参数的查找位置
Where to Find Azure Storage Parameters for Your Batch Execution Code
First, let's recap the code snippet you're working with, which requires three key storage parameters to configure:
def invokeBatchExecutionService(): storage_account_name = "mystorageacct" # Replace this with your Azure Storage Account name storage_account_key = "a_storage_account_key" # Replace this with your Azure Storage Key storage_container_name = "mycontainer" # Replace this with your Azure Storage Container name connection_string = "DefaultEndpointsProtocol=https;AccountName=" + storage_account_name + ";AccountKey=" + storage_account_key api_key = "abc123" # Replace this with the API key for the web service url = "https://ussouthcentral.services.azureml.net/workspaces/e810bf8e16bb4dec9719b07f0205b0bb/services/bc8304cebe1a42bfb2518b302eba979d/jobs" uploadFileToBlob("input1data.file_extension", # Replace this with the location of your input file, and valid file extension (usually .csv) "input1datablob.file_extension", # Replace this with the name you would like to use for your Azure blob; this needs to have the same extension as the input file storage_container_name, storage_account_name, storage_account_key)
Here's exactly where to find each parameter in the Azure Portal, step by step:
1. storage_account_name
- Log into the Azure Portal.
- In the top search bar, type Storage Accounts and select the service from the results.
- Locate the storage account you want to use for your batch execution (it might be linked to your Azure ML workspace).
- On the storage account's overview page, the Account name displayed at the top is your
storage_account_name.
2. storage_account_key
- From the same storage account page, look in the left-hand menu under Security + networking and select Access keys.
- You'll see two keys (Key1 and Key2) listed here—either one works. Copy the value from the Key field (not the full connection string) and use that for
storage_account_key. - Pro tip: Treat these keys like passwords—never share them publicly or commit them to code repos.
3. storage_container_name
- Still on the storage account page, navigate to Data storage in the left-hand menu and select Containers.
- You'll see a list of all containers in this storage account. You can use an existing container's name, or create a new one by clicking the + Container button (pick an access level that fits your use case).
- Copy the container's name into the
storage_container_namevariable.
Quick Shortcut (If Using a Linked Storage Account)
If your storage account is automatically linked to your Azure ML workspace:
- Go to your Azure ML workspace in the portal.
- In the left-hand menu under Resources, select Linked resources.
- Find the storage account listed here, click into it, and follow the steps above to grab your parameters.
内容的提问来源于stack exchange,提问作者user9270170
相关产品推荐
相关产品推荐

