Tag: azure色的

Java Azure请求签名

我正在使用最新的Azure SDK存储模拟器。 我正在尝试为我的blob签名。 当我运行以下代码时,我收到auth错误。 虽然我已多次检查过代码是否符合Azure SDK blob访问规范,但我无法弄清楚出了什么问题。 这是控制台输出: GET x-ms-date:Sun, 23 Sep 2012 04:04:07 GMT /devstoreaccount1/tweet/?comp=list SharedKey devstoreaccount1:Hx3Pm9knGwCb4Hs9ftBX/+QlX0kCGGlUOX5g6JHZ9Kw= Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature. 这是代码: public static void signRequest(HttpURLConnection request, String account, String key) throws Exception { SimpleDateFormat fmt = new SimpleDateFormat(“EEE, […]

如何通过邮递员调用REST API在Azure中创建索引?

我正在创建一个应用程序,我需要调用与创建数据源相关的REST API,如下所述: https : //docs.microsoft.com/en-us/azure/search/search-howto-indexing-azure-blob-storage 以下是我提出要求的方式: 我收到以下错误: { “error”: { “code”: “”, “message”: “The request is invalid. Details: index : The property ‘type’ does not exist on type ‘Microsoft.Azure.Search.V2016_09_01.IndexDefinition’. Make sure to only use property names that are defined by the type.\r\n” } } 我该怎么办才能正确设置’type’?

无法从Azure java SDK列出图像发布者

我正在使用Azure ARM API,并且我尝试通过Azure Java SDK按位置列出所有发布者,方法是执行以下代码: import com.microsoft.azure.management.compute.ComputeManagementClient; import com.microsoft.azure.management.compute.ComputeManagementService; import com.microsoft.azure.management.compute.models.VirtualMachineImageListPublishersParameters; import com.microsoft.azure.management.compute.models.VirtualMachineImageResourceList; @Test public void testListPublishers() { ComputeManagementClient client = ComputeManagementService.create(createConfiguration()); VirtualMachineImageListPublishersParameters params = new VirtualMachineImageListPublishersParameters(); params.setLocation(“westus”); VirtualMachineImageResourceList response = client.getVirtualMachineImagesOperations().listPublishers(params); ArrayList resources = response.getResources(); System.out.println(“Found publishers: ” + resources.size()); } 这导致以下请求: GET /subscriptions/{some-subscription}/providers/Microsoft.Compute/locations/westus/publishers?api-version=2015-06-15 但是,无论我放在发布商参数中的位置,我总是得到并清空列表。 我能够使用相同的客户端列出其他资源,因此在创建客户端时不会出现问题。 你对我可能做错了什么有什么建议吗? 也许有一个我没有的许可? 谢谢!

如何使用JDBC连接Azure SQL

我尝试使用MS JDBC驱动程序连接到Azure SQL: import java.sql.*; public class ExampleSQLJDBC { public static void main(String[] args) { // Setting. String connectionUrl = “jdbc:sqlserver://SERVER.database.windows.net:1433;database=DATABASE;encrypt=true;trustServerCertificate=true;”; String user = “USER@SERVER”; String pass = “PASSWORD”; // Declare the JDBC object. Connection conn = null; try { // Establish the connection. Class.forName(“com.microsoft.sqlserver.jdbc.SQLServerDriver”); conn = DriverManager.getConnection(connectionUrl, user, pass); } catch (Exception e) { […]