【c# – 检查SQL Azure中是否存在表】教程文章相关的互联网学习教程文章

c#-使用带有QueueTrigger的Azure WebJob,设置计划是否有效果?

我有一个具有QueueTrigger设置的Azure WebJob(因此该任务将在适当的存储队列中检测到某项时运行.上传任务时,我不清楚是否应该选择“连续运行”,“运行在时间表或按需运行如果选择按时间表运行,任务是否会在每次迭代时重新启动并执行Main()函数,然后等待触发器? 我希望作业一次运行安装程序,然后基本上等待触发器.我尝试搜索文档,但是没有找到任何指导,希望能对您有所帮助,谢谢!解决方法:经过一堆反复试验(当然,也没有安排时间,它...

c#-如何使用LINQ使用Azure AD Graph API客户端库2.0查找具有特定许可证的Azure AD用户【代码】

我从工作的sample .NET Graph API Console app开始.我希望能够查询具有特定许可证的所有用户的Azure AD.我想我必须做某种嵌套的LINQ查询. 这是我的第一次尝试IUserCollection userCollection = activeDirectoryClient.Users;searchResults = userCollection.Where(user =>user.AssignedPlans.Where(plans => plans.Service.Contains("exchange")) &&user.DisplayName.StartsWith(searchString)).ExecuteAsync().Result;usersList =...

c#-为什么Azure表存储不支持DateTimeOffset?【代码】

在任何人将其作为副本关闭之前,我知道Azure表存储本身不支持DateTimeOffset类型(MSDN states as much;尝试读写具有DateTimeOffset属性的实体不会引发异常,但不会维护正确的时间戳记要么). 我的问题是为什么不支持此数据类型,尤其是当创建Azure时就已经存在.更令人困惑的是,用于Azure Table Storage的.NET API似乎提供了对数据类型的支持:实体被转换成EntityProperty值的字典,而EntityProperty类既具有DateTimeOffsetValue属性,又...

c#-从Cloud Service中的Azure文件访问挂载

我已按照this blog post中的说明成功创建并手动测试了Azure文件中的共享.但是,如果我通过改用角色创建部署的云服务,则无法从C#创建装载或访问装载(创建或列出文件).解决方法:我可以通过使用解释为here的P / Invoke方法调用映射来解决此问题.唯一的技巧是我必须从source构建存储层并更新程序包引用,因为它使用的是Azure存储库的较旧版本. 如果您对无效的内容感兴趣: 我的第一次尝试是使用进程并调用’cmd’,但是由于权限的原因,我认...

C#-发布旧版本的MVC网站.dll的Azure Web Deploy

我通过VS 2013中的Web发布将MVC网站部署到Azure位置.我已经用同一台机器和IP地址多次发布了文章,但是昨天它停止了工作. 该发布会将我的项目.dll的旧版本放在站点的bin文件夹中.这个版本不再存在于我的机器上,它不是项目当前的Git状态(并且从未是当前的Git状态),也不是我的Release,Debug或Demo编译文件夹中的版本.我不知道它从哪里来. 因此,当我发布时,我收到与数据库更改有关的错误,因为自该旧版本以来,上下文背后的模型已更改. 因...

c#-已引发Azure MobileServiceInvalidOperation异常【代码】

我正在使用在下载用于Azure移动服务的示例时生成的xamarin.forms应用程序.我做了一些修改.首先,我将Todo更改为entry.cs:public class entry {string id;[JsonProperty("ID")]public string ID { get; set; }[JsonProperty("Time")]public int Time { get; set; }[JsonProperty("Percentage")]public int Percentage { get; set; }//I have omitted Device, Replacement, Use_profile, Longitude, Latitude, Battery }我尝试通过在...

C#-Azure-AD-AcquireTokenSilent提供错误failed_to_acquire_token_silently【代码】

我们正在使用Azure AD每30分钟进行身份验证并获取刷新的访问令牌.我们调用以下获取安全令牌并将其添加到请求标头的方法.var userObjectId = ClaimsPrincipal.Current.FindFirst("http://schemas.microsoft.com/identity/claims/objectidentifier").Value; var authContext = new AuthenticationContext(Authority, new NaiveSessionCache(userObjectId)); var credential = new ClientCredential(ConfigurationManager.AppSettings...

c#-ADAL-AcquireTokenSilentAsync失败(Azure Active Directory身份验证库)【代码】

我编写了一个新应用程序以通过其余API访问办公室数据,因此我想使用新的身份验证模型(V2.0端点) What’s different about the v2.0 endpoit 我可以致电获得令牌private static string[] scopes = { "https://outlook.office.com/mail.read", "https://outlook.office.com/calendars.read" };public async Task<ActionResult> SignIn(){... SNIPUri authUri = await authContext.GetAuthorizationRequestUrlAsync(scopes, null, clie...

C#-Azure Web作业多个连接字符串【代码】

Azure WebJob从Web应用程序(运行作业)配置参数-AzureWebJobsStorage获取连接字符串.我需要使用一个WebJob监视不同存储中的两个队列.是否有可能以某种方式为WebJob提供多个连接字符串?解决方法:与这篇文章相关的可能: > servicebus webjob different connection string for output or trigger 对于您的情况,您想绑定到不同的存储帐户,以便您的功能看起来像这样:public static void JobQueue1([QueueTrigger("queueName1"),Storag...

c#-Azure应用服务(移动应用)违反主键约束【代码】

我正在使用Azure App Services(移动应用程序)来通过SQLite使用脱机同步功能来开发应用程序.我的数据对象模型是:public class Customer : EntityData {public string FirstName { get; set; }public string LastName { get; set; }//…public DateTime DateCreated { get; set; }public DateTime DateModified { get; set; }public virtual IList<Card> Cards { get; set; } } public class Card : EntityData {public bool IsDisa...

c#-将文件上传到Azure Blob存储【代码】

我想异步地将文件上传到Azure blob存储.我尝试了官方SDK中建议的方式: 这是我得到容器的方式:public static class BlobHelper {public static CloudBlobContainer GetBlobContainer(){// Pull these from configvar blobStorageConnectionString = ConfigurationManager.AppSettings["BlobStorageConnectionString"];var blobStorageContainerName = ConfigurationManager.AppSettings["BlobStorageContainerName"];// Create bl...

c#-在Azure Service Fabric上设置TCP【代码】

我需要设置一个有状态的服务结构应用程序,该应用程序侦听TCP请求,然后将消息弹出到“可靠队列”中. HTTP和WCF端点周围有很多示例,但是对于简单的TCP我什么也找不到. 在我的ServiceManifest.xml中,我有这个<Endpoints><!-- This endpoint is used by the communication listener to obtain the port on which to listen. Please note that if your service is partitioned, this port is shared with replicas of different partiti...

c#-具有Azure Service Bus的MassTransit 3创建队列【代码】

我正在将应用程序从使用MT3和RabbitMQ转换为使用Azure Service Bus,MassTransit在Azure中配置队列的方式与对RMQ的配置方式不同,并且文档内容比较淡(here)我想看看是否有人解决了这个问题 我将MT 3.4和Microsoft.ServiceBus 3.0用于TokenProvider,我有一个创建总线的实用程序类(此example之后):public static IBus CreateBus(){var busControl = Bus.Factory.CreateUsingAzureServiceBus(sbc =>{var host = sbc.Host(new Uri("sb:/...

C# – Azure的Web应用程序的新X509Certificate2()导致System.Security.Cryptography.CryptographicException:拒绝访问【代码】

现在,我正在上传.pfx文件,输入密码并调用var cert = new X509Certificate2(fileData, password);并存储诸如指纹之类的东西.我不需要将其实际存储在服务器上,只需确认它是有效的证书并存储一些信息即可.在本地,这很有效(显然,我可以更好地访问我的密钥存储区),但是当我将其放到天蓝色时,会收到错误消息:System.Security.Cryptography.CryptographicException: Access denied.有什么方法可以使此信息避开此方法或使用此方法而不会导...

c#-访问Azure Service Fabric状态服务状态【代码】

我已将WebAPI添加到我的有状态服务中,并希望从中访问StateManager(从StatefulService类实现的外部). 最好的方法是什么? 目前,我正在为此使用一个小类:internal static class InstanceAccessor {internal static StatefulService ActiveInstance { get; set; } }并将值放在StatefulService的RunAsync方法中:protected override async Task RunAsync(CancellationToken cancellationToken) {InstanceAccessor.ActiveInstance = th...