Tag: azure

如何在Document DB java SDK中指定删除文档的NONE分区键?

我只有一个集合,当我尝试使用下面的代码删除文档时 PartitionKey partitionKey = new PartitionKey(“undefined”); RequestOptions requestOptions=new RequestOptions(); requestOptions.setPartitionKey(partitionKey); for(Document currentDocument: existingIMEIDevice){ try { ConfigVariables.documentClient.deleteDocument(currentDocument.getSelfLink(), requestOptions); } catch (DocumentClientException e) { // TODO Auto-generated catch block e.printStackTrace(); } 它抛出exception。 com.microsoft.azure.documentdb.DocumentClientException:消息:{“错误”:[“未找到资源”]} ActivityId:4353e7c0-0b24-4b2a-8ec6-fc2db4059aa0,请求URI:/ apps / 708ed403-166f-44e4-847f -ccaa0cd22d9c / services / d1e2ed4d-7e69-4a3d-9575-3e24b96621b4 / partitions / e3fc6138-06a5-4876-a629-a4be69917ded / replicas / 131533416718986721p,StatusCode:NotFound at com.microsoft.azure.documentdb.internal.ErrorUtils.maybeThrowException(ErrorUtils .java:69)com.microsoft.azure.documentdb.internal.GatewayProxy.performDeleteRequest(GatewayProxy.java:187)at com.microsoft.azure.documentdb.internal.GatewayProxy.doDelete(GatewayProxy.java:99)at com。 micros.aure.documentdb.internal.GatewayProxy.processMessage(GatewayProxy.java:332)at com.microsoft.azure.documentdb.DocumentClient […]

无法使用本地hadoop连接azure blob存储

在尝试使用Hadoop版本2.7.1将本地hadoop与AZURE BLOB存储(即使用blob存储作为HDFS )连接时,它会抛出exception 在这里,我通过设置属性成功地形成了本地群集 fs.default.name wasb://account@storage.blob.core.windows.net 然后是core-site.xml中blob存储的关键值。 列出文件或对blob存储进行HDFS操作时 ,将以下exception作为 ls: No FileSystem for scheme: wasb 有人请指导我解决上述问题。

Azure Java SDK:ServiceException:ForbiddenError:

尝试了基本位置检索器代码(如下所示) 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 ); ManagementClient client = ManagementService.create(config); // get […]

Azure从Azure Java SDK检索VirtualMachines的PublicIPAddress

由于答案是Page Not Found,我试图使用以下代码检索公共IP的大小 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 ); NetworkResourceProviderClient networkResourceProviderClient = NetworkResourceProviderService.create(config); PublicIpAddressListResponse PublicIpAddressListResponse =networkResourceProviderClient.getPublicIpAddressesOperations().listAll(); ArrayList PublicIpAddressList =PublicIpAddressListResponse.getPublicIpAddresses(); System.out.println(PublicIpAddressList.size()); 使用Azure AD ServicePrincipal身份validation,它返回 – 0 使用带有“ https://management.azure.com/”API的证书身份validation,它返回 – AuthenticationFailed: […]

通过Java客户端连接Azure服务总线

我试图从Java客户端连接Azure服务总线与AMQP协议 我按照以下链接中的说明操作: http://azure.microsoft.com/en-us/documentation/articles/service-bus-java-how-to-use-jms-api-amqp/ 1)在Azure门户中创建服务总线,名称空间为“ availo ”,队列名为“ queue1 ” 2)从服务总线连接信息我得到以下内容: SharedAccessKeyName = RootManageSharedAccessKey SharedAccessKey = {}键 3)为JNDI查找创建“servicebus.properties”文件 connectionfactory.SBCF = amqps://RootManageSharedAccessKey:encoded(key)@availo.servicebus.windows.net queue.QUEUE = queue1 4)下面是我的简单java主应用程序,在类路径中包含所有必需的jar(qpid)。 public static void main(String[] args) { try { Hashtable env = new Hashtable(); env.put(Context.INITIAL_CONTEXT_FACTORY, “org.apache.qpid.amqp_1_0.jms.jndi.PropertiesFileInitialContextFactory”); env.put(Context.PROVIDER_URL, “C:\\Users\\Assaf-PC\\Documents\\GitHub\\availo\\rest-api\\src\\main\\resources\\servicebus.properties”); Context context = new InitialContext(env); // Lookup ConnectionFactory and Queue ConnectionFactory cf = (ConnectionFactory) context.lookup(“SBCF”); […]

在Microsoft Azure Web App中部署WAR FILE

我创建了一个Microsoft azure Web应用程序并配置了java版本8和tomcat最新版本。 根据他们的文档 ,我已将WAR文件上传到d:\ home \ site \ wwwroot \ webapps \ ROOT。 MY Directory的屏幕截图 我想尝试访问,给我一个404错误。请帮我解决这个问题

我是否可以将流上传到Azure blob存储而不预先指定其长度?

我不知道它是否相关,但我使用Java与azure-storage-android-0.2.0.aar进行上传。 我可以将文件上传到Microsoft Azure blob存储 CloudBlockBlob blob = container.getBlockBlobReference(“filename.ext”); blob.upload(inputStream, n); 其中n是inputStream从文件派生时的长度。 这是我的问题:我想直接流式传输,例如来自相机,这显然是不可能的,因为Azure需要上传的长度参数,这在流式传输时是未知的。 我需要指定长度吗? (MD5?)还有一种方法可以在流仍在生成时上传(这显然是Java中的InputStream的想法,InputStream没有长度属性的原因)?

azure免费试用帐户无法通过java sdk进行身份validation

我使用简单的java sdk代码来validationazure基本连接。 我已在azure色门户网站的设置中上传了管理证书。 但是每当我尝试进行身份validation时,我都会收到以下exception: 线程“main”中的exceptioncom.microsoft.windowsazure.exception.ServiceException:ForbiddenError:服务器无法validation请求。 validation证书是否有效并与此订阅相关联。 at com.microsoft.windowsazure.exception.ServiceException.createFromXml(ServiceException.java:206)at com.microsoft.windowsazure.management.LocationOperationsImpl.list(LocationOperationsImpl.java:162)at com.mycompany.testproj1.test1.main(test1)的.java:46) 当我尝试使用azure cli下载证书时 $ azure帐户证书导出信息:执行命令帐户证书导出错误:此订阅不使用管理证书信息:错误信息已记录到/Users/tt/.azure/azure.err错误:帐户证书导出命令失败 这与我使用免费试用有关吗?

在Azure App Service上部署Spring Boot jar

我在使用Spring Boot API处理Azure应用服务时遇到问题。 我在https://docs.microsoft.com/en-us/java/azure/spring-framework/deploy-spring-boot-java-web-app-on-azure上关注了Microsoft指南,但没有运气远。 应用程序确实启动(我可以看到应用程序在日志文件中启动)但是对应用程序服务URL的http请求总是以超时结束。 我已经读过Azure应用服务只能选择在端口80或8080上运行的嵌入式tomcat服务器,但也没有运气。 该应用程序部署在www根目录中,并且还部署了适当的web.config。 我尝试使用和不使用应用程序服务器运行App Service(Tomcat和Jetty,因为服务器嵌入在应用程序中而不需要),但两种方法都失败了。 我错过了其他一些配置部分吗? 或者这可能与我在azure色上使用的计划类型有关? 也许资源有些问题? 有什么指针吗? 谢谢, 伯特

Microsoft Translator API Java,如何使用Azure获取客户端新ID

Translate.setClientId( “东西”); Translate.setClientSecret( “something1”); 我之前使用以下语法成功运行了我的代码,但是,有50%的时间我会收到错误消息: TranslateApiException:找不到与请求凭据关联的活动Azure市场转换器订阅。 : 我的应用程序订阅了Microsoft正在使用的OLD网站,但我认为问题正在发生,因为他们正在使用Azure。 现在,我的应用程序订阅了Azure,我订阅了Microsoft Translator API服务。 想知道如何将其设置为Azure提供的新ClientID,ClientSecret。 这是我首先订阅的“旧”网站: https : //datamarket.azure.com/home/