我正在尝试什么应该是一个非常基本的任务.我已经创建了一个工作站模板的本地VHD,我想上传它以便在我的Azure环境中使用.我在Azure Powershell工作.
我上传了我的.cer文件来创建管理证书.我已导入.publishsettings文件,我可以使用Set-AzureSubscription和Select-AzureSubscription,没有明显的问题:
Set-AzureSubscription -SubscriptionName "Windows Azure Enterprise" -CurrentStorageAccount ATOQA
Select-AzureSubscription -SubscriptionName "Windows Azure Enterprise"
Run Code Online (Sandbox Code Playgroud)
我遇到的问题是当我尝试使用Add-AzureVHD时:
PS C:\Program Files\Microsoft SDKs\Windows Azure\.NET SDK\2012-10\bin> add-azurevhd -destination "https://ATOQA.blob.core.windows.net/vhds/ztemplate-W7.vhd" -localfilepath "C:\VM\W7_Template\ztemplate-w7.vhd"
add-azurevhd : "An exception occurred when calling the ServiceManagement API. HTTP Status Code: 404. Service Management Error Code: ResourceNotFound. Message: The requested storage account
'atoqa' was not found.. Operation Tracking ID: df91c24901254047b39a7a7d5b037ea0."
At line:1 char:1
+ add-azurevhd -destination "https://ATOQA.blob.core.windows.net/vhds/ztemplate-W7 ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [Add-AzureVhd], ServiceManagementClientException
+ FullyQualifiedErrorId : Microsoft.WindowsAzure.Management.ServiceManagement.StorageServices.AddAzureVhdCommand …
Run Code Online (Sandbox Code Playgroud) 我有一个用户表,主用哈希键为userId.每个用户可能/可能没有称为"环境"的字符串属性.我想让所有拥有"environment"="xyz"或没有"environment"属性的用户.
以下代码将使用environment = xyz过滤这些用户,但如何过滤那些没有环境的项目?Dynamo API不允许过滤空字符串.
AmazonDynamoDBClient client = DbClientManager.getDynamoDbClient();
ArrayList<AttributeValue> avList = new ArrayList<AttributeValue>();
avList.add(new AttributeValue().withS("xyz"));
Condition scanFilterCondition = new Condition()
.withComparisonOperator(ComparisonOperator.EQ.toString())
.withAttributeValueList(avList);
Map<String, Condition> conditions = new HashMap<>();
conditions.put("environment", scanFilterCondition);
ScanRequest scanRequest = new ScanRequest()
.withTableName("users")
.withAttributesToGet(
"userId",
"environment");
.withScanFilter(conditions);
ScanResult result = client.scan(scanRequest);
Run Code Online (Sandbox Code Playgroud)
现在我刚刚删除了扫描过滤器,我在客户端进行过滤.有没有办法在服务器方面做到这一点?
谢谢,Aliza
我有代码将blob插入存储,并允许用户查看blob列表和单个blob.但是,我现在无法删除blob,出现的错误是
"System.ServiceModel.ni.dll中出现'System.ServiceModel.FaultException`1'类型的异常,但未在用户代码中处理.附加信息:远程服务器返回错误:(404)Not Found."
WCF服务中的代码是
public void DeleteBlob(string guid, string uri)
{
//create the storage account with shared access key
CloudStorageAccount storageAccount = CloudStorageAccount.Parse(accountDetails);
CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();
CloudBlobContainer container = blobClient.GetContainerReference(guid);
CloudBlockBlob blob = container.GetBlockBlobReference(uri);
blob.DeleteIfExists();
}
Run Code Online (Sandbox Code Playgroud)
然后我通过SOAP服务在移动客户端应用程序中访问它,如:
private void mnuDelete_Click(object sender, EventArgs e)
{
MessageBoxResult message = MessageBox.Show("Are you sure you want to delete this image?", "Delete", MessageBoxButton.OKCancel);
if (message == MessageBoxResult.OK)
{
Service1Client svc = new Service1Client();
svc.DeleteBlobCompleted += new EventHandler<AsyncCompletedEventArgs>(svc_DeleteBlobCompleted);
svc.DeleteBlobAsync(container, uri);
}
}
void svc_DeleteBlobCompleted(object sender, …
Run Code Online (Sandbox Code Playgroud) 我创建了一个如下所示的 Azure 函数(实际上,Microsoft 模板完成了大部分工作!):
[FunctionName("Function1")]
public static void Run([ServiceBusTrigger("%queue-name%", AccessRights.Listen)]string myQueueItem, TraceWriter log)
{
log.Info($"C# ServiceBus queue trigger function processed message: {myQueueItem}");
}
Run Code Online (Sandbox Code Playgroud)
我的 local.settings.json 看起来像这样:
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "..",
"AzureWebJobsDashboard": "..",
"AzureWebJobsServiceBus": "..",
"queue-name": "testqueue"
}
}
Run Code Online (Sandbox Code Playgroud)
然后我部署了这个功能。这是一个奇怪的问题,因为我的问题是它立即起作用,但我没想到它会起作用。function.json 在这里:
{
"generatedBy": "Microsoft.NET.Sdk.Functions-1.0.0.0",
"configurationSource": "attributes",
"bindings": [
{
"type": "serviceBusTrigger",
"queueName": "%queue-name%",
"accessRights": "listen",
"name": "myQueueItem"
}
],
"disabled": false,
"scriptFile": "..\\bin\\FunctionApp8.dll",
"entryPoint": "FunctionApp8.Function1.Run"
}
Run Code Online (Sandbox Code Playgroud)
显然,local.settings.json 中的值已复制到功能设置中,但我在门户中看不到它们。我的问题是:这些设置现在存储在哪里(队列名称和 AzureWebJobsServiceBus)?
编辑:
该功能的我的应用程序设置:
我有一个关于TFS的项目,该项目正在除我之外的其他所有人的机器上工作。在构建时,出现了可以在图像中看到的错误。“指定的任务可执行文件位置csc.exe无效。” 当前正在尝试修复VS 2017。
我尝试使用 REST API 和.NET 客户端库获取 TFS 的所有成员/用户。
它有效,但我最多获得 50 个身份。有谁知道,我如何获得所有用户,而不仅仅是 50 个?(我更喜欢避免使用旧的 API,在这个问题中是如何建议的)
这是我的代码:
VssCredentials credentials = new VssCredentials();
VssConnection connection = new VssConnection(new Uri(url), credentials);
IdentityMruHttpClient identityMruHttpClient = connection.GetClient<IdentityMruHttpClient>();
List<IdentityRef> members = identityMruHttpClient.GetIdentityMruAsync(ProjectName).Result;
Run Code Online (Sandbox Code Playgroud) 我们使用与IExtensionConfigProvider的参数绑定在Azure函数(netstandard20上的v2)中使用依赖注入.将Microsoft.NET.Sdk.Functions从1.0.13升级到1.0.19(强制将Microsoft.Azure.Webjobs.Host升级到v3)之后,这不再起作用了.我无法在IExtensionConfigProvider.Initialize函数中找到断点.相同版本的Functions SDK适用于具有目标框架net462的示例项目,它使用Microsoft.Azure.WebJobs v2.
这是它在运行时给出的错误:
错误索引方法'Function1.Run'.Microsoft.Azure.WebJobs.Host:无法将参数'customThing'绑定到CustomType类型.确保绑定支持参数Type.
这是示例应用程序的代码:
public static class Function1
{
[FunctionName("ThisFunction")]
public static async Task Run(
[TimerTrigger("0 */1 * * * *")]TimerInfo timer,
[Inject(typeof(CustomType))] CustomType customThing,
ExecutionContext context)
{
Console.WriteLine(customThing.GetMessage());
}
}
public class CustomType
{
public string GetMessage() => "Hi";
}
[Binding]
[AttributeUsage(AttributeTargets.Parameter)]
public class InjectAttribute : Attribute
{
public Type Type { get; }
public InjectAttribute(Type type) => Type = type;
}
public class InjectConfiguration : IExtensionConfigProvider
{
private IServiceProvider _serviceProvider;
public void Initialize(ExtensionConfigContext context)
{
var …
Run Code Online (Sandbox Code Playgroud) 不确定我只是遇到了这个问题,或者每个人都遇到过这个问题,我正在尝试访问https://marketplace.visualstudio.com
但无法访问!
网站上是否存在任何问题/中断(Microsoft)?
我Ctrl+ click通过各种函数的定义,在Go。有时我钻得太深了。我想向上移动已访问文件的堆栈。如何在VS Code中做到这一点?
嗨,我正在尝试在我的 azure 帐户上配置一个基本的流量管理器。但是当我使用流量管理器 URL 时,我总是找不到 404。
我有两个用于 TM 端点的应用服务:
1. xxxus.azurewebsites.net
2. xxxeu.azurewebsites.net
TM 网址是:
xxxtm.trafficmanage.net
我能够使用 www.whatsmydns.net 来检查 tm 的目标。
但是当我使用 TM 网址时,我得到了这个:
有没有人有同样的问题?期待您的帮助
谢谢