azure-python-sdk

how to add LogAnalyticsWorkSpace extension to VM using Python SDK in Azure

how to add LogAnalyticsWorkSpace extension to VM using Python SDK in Azure Question: I have created Log Analytics workspace in azure. Now to want to attach it as an extension to VM using Python sdk. I have followed the documentation and getting error as follow. class ‘azure.core.exceptions.HttpResponseError’> occurred. Can someone help me in this please. …

Total answers: 1

How to lock storage accounts in Azure using Python SDK

How to lock storage accounts in Azure using Python SDK Question: I am using python SDK to lock a particular azure resource. Although I found documentation, I am getting exceptions as a resource not found while I am trying to lock the storage account. As I am trying to store accounts in a Resource Grp, …

Total answers: 2

Include only blob 'name' property in list_blobs() response? – Azure Python SDK

Include only blob 'name' property in list_blobs() response? – Azure Python SDK Question: Currently, I am using the list_blobs() function in the Azure Python SDK to list all of the blobs within a container. However, in terms of the metadata/info of the blobs, I only require the names of the blobs. In my container, there …

Total answers: 2

Deleting files from blob – TypeError: quote_from_bytes() expected bytes

Deleting files from blob – TypeError: quote_from_bytes() expected bytes Question: I have some files inside a container named data: folder1/somepath/folder2/output/folder3/my_file1.csv folder1/somepath/folder2/output/folder3/my_file4.csv folder1/somepath/folder2/output/folder3/my_file23.csv I have the following code: file_names_prefix = os.path.join(‘folder1/somepath/’,’folder2′,’output’,’folder3′,’my_file’) client = BlobServiceClient(‘https://mystoragename.blob.core.windows.net’,credential=ManagedIdentityCredential()).get_container_client(‘data’) blob_list = client.list_blobs(name_starts_with=file_names_prefix) file_list = [blob.name for blob in blob_list] The code above produces the following output: [‘folder1/somepath/folder2/output/folder3/my_file1.csv’, ‘folder1/somepath/folder2/output/folder3/my_file4.csv’, ‘folder1/somepath/folder2/output/folder3/my_file23.csv’] but when …

Total answers: 3