azure-java-sdk

Unable to programmatically get the keys for Azure Storage Account

旧城冷巷雨未停 提交于 2021-02-11 12:29:29
问题 I am trying to get the keys for all the Storage Accounts in my subscription. But I am getting this exception on one of the Storage Account using Azure Java SDK. com.microsoft.azure.CloudException: Status code 403, {"error":{"code":"AuthorizationFailed","message":"The client '5c79ee27-#########-######91f8e3' with object id '5c79ee27-###########-#####91f8e3' does not have authorization to perform action 'Microsoft.Storage/storageAccounts/listKeys/action' over scope '/subscriptions/758ad253-####

Azure Blob Error: StorageException: The condition specified using HTTP conditional header(s) is not met

假装没事ソ 提交于 2021-01-28 09:01:40
问题 So I have a function that simply downloads text from blob storage every 10 minutes and checks for a result. This function can run for days. But it often (roughly every day) fails before finishing with the following error. Caused by: com.microsoft.azure.storage.StorageException: The condition specified using HTTP conditional header(s) is not met. My code is pretty simple. public String downloadTextBlob(CloudBlobDirectory dir, String filename) { try { return dir.getBlockBlobReference(filename)

Azure Java SDK - set block blob to cool storage tier on upload

雨燕双飞 提交于 2021-01-27 14:17:18
问题 Is there a way to set the storage tier to “cool” at the blob level when uploading a block blob to Azure Storage using the Java SDK? The closest thing I can find is setStandardBlobTier() on BlobProperties, which is a protected method, so it can't be accessed. 回答1: The class CloudBlockBlob now has two uploadStandardBlobTier() methods which can be used to set the blob tier on a block blob on a standard storage account. e.g. cloudBlockBlob.uploadStandardBlobTier(StandardBlobTier.COOL); 回答2: I

How to generate azure blob storage SAS url using java?

余生长醉 提交于 2021-01-07 01:20:29
问题 I want to generate a SAS url that i can share with user to connect to storage account and upload a file to any location. How can i generate the SAS url using java api. i found one documentation but looks like all api are depreciated https://azuresdkdocs.blob.core.windows.net/$web/java/azure-storage-blob/12.0.0/com/azure/storage/blob/sas/BlobServiceSasSignatureValues.html Env: Java Version: 8.0 BLOB STORAGE JAVA SDK: group: 'com.azure', name: 'azure-storage-blob', version: '12.8.0' 回答1: There

Azure Java SDK: How to disable logging to console?

孤人 提交于 2020-08-09 08:14:13
问题 I'm developing an application using Azure's Java SDK and Maven . This application sends data to an IoT Hub and some other functionalities that are not important for the scope of the question. I implemented my own logging inside the application by using log4j2 and I'm fine with that since I can modify and change it however I want. The problem arose when I checked this warning that was coming up in my application's console output: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".

Azure Java SDK: How to disable logging to console?

巧了我就是萌 提交于 2020-08-09 08:13:29
问题 I'm developing an application using Azure's Java SDK and Maven . This application sends data to an IoT Hub and some other functionalities that are not important for the scope of the question. I implemented my own logging inside the application by using log4j2 and I'm fine with that since I can modify and change it however I want. The problem arose when I checked this warning that was coming up in my application's console output: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".

Use Microsoft Azure java SDK Resource Management API or Service Management API?

送分小仙女□ 提交于 2020-01-07 03:05:43
问题 I am able to successfully connect to resource management API using Java SDK. Once the connection is successful, can I continue with ARM to list resources at subscription level like os images, locations, regions etc using ARM? Or do I need to again shift to Service Mgmt API? Is every operation doable with the new ARM API? 回答1: According to your comment for @juvchan, I knew you want to list os images and vm images for creating a VM in Azure Java SDK. As @juvchan said, the ARM APIs are different

Azure Java SDK: ServiceException: ForbiddenError:

孤街浪徒 提交于 2019-12-31 06:48:49
问题 Tried the basic location retriever code (shown below) String uri = "https://management.core.windows.net/"; String subscriptionId = "XXXXXXXX-5fad-XXXXXX-9dfa-XXXXXX"; String keyStoreLocation = "D:\\test.jks"; String keyStorePassword = "123456"; Configuration config = ManagementConfiguration.configure( new URI(uri), subscriptionId, keyStoreLocation, // the file path to the JKS keyStorePassword, // the password for the JKS KeyStoreType.jks // flags that I'm using a JKS keystore );

Azure Java SDK: ServiceException: ForbiddenError:

◇◆丶佛笑我妖孽 提交于 2019-12-31 06:48:00
问题 Tried the basic location retriever code (shown below) String uri = "https://management.core.windows.net/"; String subscriptionId = "XXXXXXXX-5fad-XXXXXX-9dfa-XXXXXX"; String keyStoreLocation = "D:\\test.jks"; String keyStorePassword = "123456"; Configuration config = ManagementConfiguration.configure( new URI(uri), subscriptionId, keyStoreLocation, // the file path to the JKS keyStorePassword, // the password for the JKS KeyStoreType.jks // flags that I'm using a JKS keystore );

How to check the health of application gateway in Azure

我的未来我决定 提交于 2019-12-23 04:47:12
问题 How to check the health of application gateway using java sdk. I need to perform a similar operation like below azure cli command using java sdk: azure network application-gateway backend-health show "$1" "$2" --json \ | jq -r '.backendAddressPools[].backendHttpSettingsCollection[].servers[] | select(.health == "Healthy") | .address' 回答1: I tried to get the health value of your pipeline command via the method health() of the class ApplicationGatewayBackendHealthServer of Azure Java SDK, but